<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>CSS表格样式</title>
    <style>
      table,
      th,
      td {
        border: 2px solid black;
      }
      table {
        border-collapse: collapse;
      }
      tr:nth-child(even) {
        background-color: RGB(0, 0, 0, 0.2);
      }
    </style>
  </head>
  <body>
    <table>
      <tr>
        <th>学号</th>
        <th>姓名</th>
      </tr>
      <tr>
        <td>001</td>
        <td>张三</td>
      </tr>
      <tr>
        <td>002</td>
        <td>李四</td>
      </tr>
      <tr>
        <td>003</td>
        <td>王五</td>
      </tr>
    </table>
  </body>
</html>
